package com.itheima.mapper;

import com.itheima.pojo.Emp;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface EmpMapper {

    //  添加
    void addEmp(Emp emp);

    //修改
    void updateEmp(Emp emp);

    //删除
    void deleteEmp(Integer id);

    //查找
    List<Emp> list(String name, Short gender, LocalDate begin, LocalDate end);

    // id查找
    Emp findById(Integer id);
//    登录

    @Select("select id, username, password, name, gender, image, job, entrydate, dept_id, create_time, update_time " +
            "from emp " +
            "where username=#{username} and password =#{password}")
    public Emp getByUsernameAndPassword(Emp emp);
}
